var https = require('https');
const { Add, Update, Exec, Query, QueryById, QueryOne } = require('../db/dbhelper');
var { init, format } = require('../models/usertoken');


//新增
const usertokenAdd = function (doc) {
  return Add('hzz_usertokens', init(doc));
}

//修改
const usertokenUpdate = function (doc) {
  return Update('hzz_usertokens', format(doc));
}

//查询详情
const usertokenGetInfo = function (pcode) {
  return QueryOne('hzz_usertokens', {pcode: pcode});
}

const usertokenQueryOne = function(doc, select){
  return QueryOne('hzz_usertokens', doc, select);
}

module.exports = {
  usertokenAdd,
  usertokenUpdate,
  usertokenGetInfo,
  usertokenQueryOne
}